This application contains subject matter protected by Copyright Law. All rights reserved.
1. Technical Field
The present invention relates generally to Internet publishing technologies and, in particular, to techniques for dynamically serving web page content.
2. Description of the Related Art
A Hypertext Markup Language (HTML) file uses a limited set of tags to convey basic information about the structure of a web document, e.g., whether given text is a heading or a paragraph. With HTML, the style and logic of the document are hardcoded. HTML does not provide tags that define the meaning of the page element. To address this limitation, web content is now being authored in eXtensible Markup Language (XML), which provides a way for an author to create a custom markup language to suit a particular kind of document. In XML, each document is an object, and each element of the document is an object. The logical structure of the document typically is specified in a Document Type Definition (DTD). A DTD may be used by the author to define a grammar for a set of tags for the document so that a given application may validate the proper use of the tags. A DTD comprises a set of elements and their attributes, as well as a specification of the relationship of each element to other elements. Once an element is defined, it may then be associated with a stylesheet, a script, HTML code or the like. Thus, with XML, an author may define his or her own tags and attributes to identify structural elements of a document, which may then be validated automatically. An XML document""s internal data structure representation is a Document Object Model (DOM). The DOM makes it possible to address a given XML page element as a programmable object. It is basically a tree of all the nodes in an XML file.
Page serving technologies are evolving at a rapid pace. Since 1997, three new major technologies have attempted to supplement, if not replace, dynamically generated HTML, i.e. database or CGI scripts used to generate a web page on the fly. These technologies are Microsoft""s active server page (ASP), Sun Microsystems""s Java server page (JSP), and the Extensible Style Sheet Language (XSL/XSLT) being promoted by the World Wide Web Consortium (W3C). They provide for the generation and serving of dynamic web page content by enabling a page creator to write HTML and then to embed pure programming logic inside the page markup. Microsoft""s ASP and Sun""s JSP are very similar in that they both are essentially web templates that enable given code (e.g., code written in Java) to be embedded in static HTML to be served in response to a client browser request. In an illustrative example, a server (and, in particular, a Java runtime servlet) responds to a client jsp request as follows: the servlet retrieves a flat file corresponding to the requested page, translates that file into a Java servlet, compiles the servlet, class loads the servlet, and then invokes the servlet to cause given (e.g., customized) web content to be returned to the requesting browser. XSL/XSLT, to the contrary, is rooted in formatting and manipulating XML. XSLT, in particular, provides extensible mechanisms for defining templates to manipulate XML of any custom DTD.
The existing techniques for serving dynamic content have various limitations. Conventional server-side scripting on a web page can be complicated and, therefore, such scripting is usually difficult to maintain and evolve. Further, with existing technologies, typically only a single scripting language is allowed on a web page. This limitation is acceptable, so long as only one author is responsible for editing the page, or if all of the responsible authors know and use the same scripting language and the language of choice is supported by the web server. Microsoft""s ASP technology supports multiple scripting languages, but only one language may be used on a page. Moreover, multiple languages cannot be embedded in one another, and their order of execution is undefined. Further, page-serving technologies such as ASP and JSP are not XML-compliant, and neither ASP nor JSP provides an extension mechanism to allow authors to add custom tags.
It is also known in the art to provide a web page author with a library of preexisting custom tags. An illustrative product of this type is Cold Fusion, which is HTML-centric. This product, however, does not afford the author the ability to create custom tags. Macromedia""sDreamweaver product has a tag construction mechanism, but this product does not allow for the embedding of custom tags, nor does it allow the document to be reorganized by the tags. It also keeps the script code on the page. In particular, the script is hidden from the user, but it is still present on the page, and it may be viewed and/or edited from within another editor. However, the modifications made in another tool are not maintained. Microsoft provides a similar technology, called design-time control (DTC), that hides code from the user but still maintains the code on the page. DTC is not XML-compliant and it does not allow DTCs to be embedded within one another. Nor does the DTC mechanism allow the document to be reorganized . In addition, the DTC syntax is quite cumbersome for the page author. Moreover, while other DTC-aware tools will hide the script code correctly, basic text-editors can still edit the code, and the changes made will not be importable back into the DTC-aware tools. DTC also does not provide access to the Document Object Model. Other products or technologies that have custom tag extensions include HeiTML and Meta-HTML. Essentially, these are tag macro definition languages for HTML. Such languages, however, are not XML compliant.
Another problem associated with prior art page authoring techniques is that authors typically write tags in whichever case most suits the author. Thus, a given author may write a tag as xe2x80x9cHTML,xe2x80x9d xe2x80x9chtml,xe2x80x9d xe2x80x9cHtMlxe2x80x9d or some other variant. XML, however, is case-sensitive, while HTML and other tag handling mechanisms are not. Thus, it has also not been possible to obtain case-insensitive tag recognition from case-sensitive tag language.
There remains a need in the art to provide new techniques for publishing Internet content that can fully leverage the manipulation and template mechanism of XSLT with the scripting capability of the JSP/ASP model. The present invention addresses this need.
An object of the present invention is to provide a method for processing custom tags in a document object model (DOM) representation irrespective of the case in which the tags are authored.
A further object of this invention is to enable a custom tag used in a document object model (DOM) tree to be defined with an associated case sensitive attribute. When that attribute indicates that the custom tag name is not case sensitive, the name of the tag together with a variant of the name are stored in a registry. If, however, the attribute indicates that the custom tag name is case sensitive, only the name of the tag is registered. Later, when the custom tag is processed, a tag recognition routine is used to convert the tag name to a neutral or lower case if necessary to invoke the required tag handler.
In an illustrative embodiment, a document object model (DOM) tree is processed to identify custom tags. Upon encountering a custom tag, an appropriate tag handler (e.g., a Java object, an XSL stylesheet, or the like) is invoked. According to the invention, a tag registration routine is used for recognizing and handling case-insensitive custom tags. As a servlet engine is examining a tag name, if the name does not match one of the registered tags, the routine converts the name to lower or neutral case. If the tag recognition routine recognizes the name as one of the case-insensitive tags, it converts the attributes to the appropriate case, and hands the resulting element off to a correct tag handler for processing.
The foregoing has outlined some of the more pertinent objects and features of the present invention. These objects should be construed to be merely illustrative of some of the more prominent features and applications of the invention. Many other beneficial results can be attained by applying the disclosed invention in a different manner or modifying the invention as will be described. Accordingly, other objects and a fuller understanding of the invention may be had by referring to the following Detailed Description of the Preferred Embodiment.